home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 October: Technology Seed / ADC Seed CD - October 1999.toast / FireWire / FireWire_2.1_SDK_DR3 / Source / SBP2 / SBP2DemoApp / SBP2DemoApp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-17  |  4.5 KB  |  175 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        SBP2DemoApp.h
  3.  
  4.     Contains:    Definitions for SBP-2 demo application.
  5.  
  6.     Version:    1.0
  7.  
  8.     Copyright:    © 1998-1999 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     File Ownership:
  11.  
  12.         DRI:                Eric Anderson
  13.  
  14.         Other Contact:        
  15.  
  16.         Technology:            FireWire
  17.  
  18.     Writers:
  19.  
  20.         (EA)    Eric Anderson (ewa)
  21.  
  22.     Change History (most recent first):
  23.  
  24.        <FW6>     1/10/99    EA        Added support for testing cable power management API.
  25.        <FW5>    12/31/98    EA        Added support for Query Logins.
  26.        <FW4>    12/31/98    EA        Added support for sending a TARGET RESET management ORB.
  27.        <FW3>    11/18/98    EA        Added LUN to our global data.
  28.        <FW2>     9/20/98    EA        Filled in header comments.
  29.        <FW1>     9/20/98    EA        first checked in
  30. */
  31.  
  32.  
  33. #ifndef __SBP2DEMOAPP__
  34. #define __SBP2DEMOAPP__
  35.  
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39.  
  40. #if PRAGMA_IMPORT_SUPPORTED
  41. #pragma import on
  42. #endif
  43.  
  44. #if PRAGMA_ALIGN_SUPPORTED
  45. #pragma options align=mac68k
  46. #endif
  47.  
  48. // These are for positioning the dialogs.
  49.  
  50. #define kDITop                    0x0050
  51. #define kDILeft                    0x0070
  52.  
  53. // kExtremeNeg and kExtremePos are used to set up wide open rectangles and
  54. // regions.
  55.  
  56. #define kExtremeNeg                (-32768)
  57. #define kExtremePos                (32767 - 1)                // Required to address an old region bug
  58.  
  59. enum
  60. {
  61.     kInvalidWindowRef            = 0
  62. };
  63.  
  64. enum
  65. {
  66.     kMenuBarResourceID            = 128,
  67.  
  68.     kSBP2DemoWindowResourceID    = 128,
  69.  
  70.     kAboutAlertResourceID        = 128
  71. };
  72.  
  73. enum
  74. {
  75.     kAppleMenuID                = 128,
  76.     kAboutAppleMenuItem            = 1,
  77.  
  78.     kFileMenuID                    = 129,
  79.     kNewFileMenuItem            = 1,
  80.     kCloseFileMenuItem            = 4,
  81.     kQuitFileMenuItem            = 12,
  82.  
  83.     kEditMenuID                    = 130,
  84.     kUndoEditMenuItem            = 1,
  85.     kCutEditMenuItem            = 3,
  86.     kCopyEditMenuItem            = 4,
  87.     kPasteEditMenuItem            = 5,
  88.     kClearEditMenuItem            = 6,
  89.  
  90.     kCommandMenuID                = 131,
  91.     kLoginMenuItem                = 1,
  92.     kLogoutMenuItem                = 2,
  93.     kQueryLoginsMenuItem        = 4,
  94.     kStatusInquiryMenuItem        = 6,
  95.     kModeSenseMenuItem            = 7,
  96.     kReadBlockMenuItem            = 8,
  97.     kTargetResetMenuItem        = 9,
  98.     kPowerTestMenuItem            = 10
  99. };
  100.  
  101. struct SBP2DemoAppDataStruct
  102. {
  103.     QDGlobals                    qdGlobals;                // Quickdraw globals for our application.
  104.  
  105.     struct SBP2DemoDataStruct
  106.                                 *sbp2DemoDataList;        // List of devices.
  107.  
  108.     AEEventHandlerUPP            openApplicationEventHandler;    // Handler for open application events.
  109.     Boolean                        openApplicationEventHandlerInstalled;    // True if handler was successfully installed.
  110.  
  111.     AEEventHandlerUPP            openDocumentsEventHandler;    // Handler for open documents events.
  112.     Boolean                        openDocumentsEventHandlerInstalled;    // True if handler was successfully installed.
  113.  
  114.     AEEventHandlerUPP            printDocumentsEventHandler;    // Handler for print documents events.
  115.     Boolean                        printDocumentsEventHandlerInstalled;    // True if handler was successfully installed.
  116.  
  117.     AEEventHandlerUPP            quitApplicationEventHandler;    // Handler for quit application events.
  118.     Boolean                        quitApplicationEventHandlerInstalled;    // True if handler was successfully installed.
  119.  
  120.     AEEventHandlerUPP            deviceAddedEventHandler;    // Handler for device added events.
  121.     Boolean                        deviceAddedEventHandlerInstalled;    // True if handler was successfully installed.
  122.  
  123.     AEEventHandlerUPP            deviceRemovedEventHandler;    // Handler for device removed events.
  124.     Boolean                        deviceRemovedEventHandlerInstalled;    // True if handler was successfully installed.
  125.  
  126.     SBPClientID                    sbpClientID;            // Our client ID for the sample driver family.
  127.  
  128.     Boolean                        inForeground;            // True if app is in foreground.
  129.     Boolean                        quit;                    // Flag to tell event loop to quit.
  130. };
  131. typedef struct SBP2DemoAppDataStruct
  132.                                 SBP2DemoAppData,
  133.                                 *SBP2DemoAppDataPtr;
  134.  
  135. struct SBP2DemoDataStruct
  136. {
  137.     struct SBP2DemoDataStruct
  138.                                 *pNextSBP2DemoData;    // Link to next data record.
  139.     WindowRef                    sbp2DemoWindowRef;    // Window reference for this device.
  140.     SBPDriverID                    sbpDriverID;        // Reference to driver we control.
  141.     Boolean                        login;                // True if logged in.
  142.     Boolean                        reconnecting;    
  143.     Boolean                        reconnectFailed;    
  144.     UInt32                        lastCommand;
  145.     UInt32                        lastError;
  146.     SBPQueryLoginsParams        sbpQueryLoginsParams;
  147.     SBPStatusInquiryParams        sbpStatusInquiryParams;
  148.     SBPModeSenseParams            sbpModeSenseParams;
  149.     SBPReadBlockParams            sbpReadBlockParams;
  150.     SBPTargetResetParams        sbpTargetResetParams;
  151.     SBPPowerTestParams            sbpPowerTestParams;
  152.     UInt32                        notificationCounter;
  153.     UInt32                        notificationEvent;
  154.     UInt32                        notificationLength;
  155.     Ptr                            notificationMessage;
  156.     UInt32                        lun;
  157. };
  158. typedef struct SBP2DemoDataStruct
  159.                                 SBP2DemoData,
  160.                                 *SBP2DemoDataPtr;
  161.  
  162. #if PRAGMA_ALIGN_SUPPORTED
  163. #pragma options align=reset
  164. #endif
  165.  
  166. #if PRAGMA_IMPORT_SUPPORTED
  167. #pragma import off
  168. #endif
  169.  
  170. #ifdef __cplusplus
  171. }
  172. #endif
  173.  
  174. #endif /* __SBP2DEMOAPP__ */
  175.